#ifndef RPC_SHARE_HPP
#define RPC_SHARE_HPP

#include "ctor_helper.hpp"
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/sync/named_mutex.hpp>

namespace rpc_monitor{

namespace bi=boost::interprocess;

template <typename CT>
class rpc_share
{
protected:
	ctor_helper<bi::managed_shared_memory, CT, bi::shared_memory_object> m_memory;
	ctor_helper<bi::named_mutex, CT> m_mutex;
public:
	rpc_share(const char * p_memory_name, const int p_memory_size, const char *p_mutex_name);
	rpc_share(const char * p_memory_name, const char *p_mutex_name);
	virtual ~rpc_share();
};

template <typename CT>
rpc_share<CT>::rpc_share(const char * p_memory_name, const int p_memory_size, const char *p_mutex_name) : m_memory(p_memory_name, p_memory_size), m_mutex(p_mutex_name) {
};

template <typename CT>
rpc_share<CT>::rpc_share(const char * p_memory_name, const char *p_mutex_name) : m_memory(p_memory_name), m_mutex(p_mutex_name) {
};

template <typename CT>
rpc_share<CT>::~rpc_share() {
};

};

#endif /* #ifndef RPC_SHARE_HPP */
